

from tkinter import *



root = Tk()

# e = Entry(root)
# e.pack(padx=10,pady=10)
# e.insert(0,"我去")

title = Label(root,
        text="请输入你的名字和工作")

nameLabel = Label(root,text="名字：")
jobLabel = Label(root,text="工作：")
salary = Label(root,text="工作：")
passLabel = Label(root,text="密码：")

name = Entry(root)
job=Entry(root)
salary=Entry(root)
password=Entry(root,show="+")

def getInfo():
    print("人名：《%s》"% name.get())
    print("工作：《%s》"% job.get())
    print("密码：《%s》"% password.get())

def exit():
    root.quit()

btn1 = Button(root,
        text="获取信息",
        command=getInfo,
        fg="#fff",
        width=10,
        bg="#00C1DE")

btn_cancle = Button(root,
        text="退出",
        command=exit,
        fg="#fff",
        width=10,
        bg="#00CC6A")


nameLabel.grid(row=0,column=0)
jobLabel.grid(row=1,column=0)
passLabel.grid(row=2,column=0)

name.grid(row=0,column=1,padx=10,pady=5)
job.grid(row=1,column=1,padx=10,pady=5)
password.grid(row=2,column=1,padx=10,pady=5)

btn1.grid(row=3,column=0,sticky=W,padx=10,pady=5)
btn_cancle.grid(row=3,column=1,sticky=E,padx=10,pady=5)


mainloop()